<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>定时任务管理</title>
		<link rel="stylesheet" href="../webjars/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../webjars/css/global.css" media="all">
		<link rel="stylesheet" href="../webjars/plugins/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="../webjars/css/table.css" />
	</head>

	<body>
		<div class="admin-main">
			<form action="" class="layui-form" method="post">
              <div class="layui-inline">
                <select id="env_select" name="env" asnycSelect="../admin/profile/options" lay-filter="env_select">
                  <option value="">请选择环境</option>
                </select>     
              </div>
              <div class="layui-inline">
                <select id="group_select" name="groupName">
                  <option value="">请选择任务组</option>
                </select>     
              </div> 
              <div class="layui-inline">
                <input type="button" class="layui-btn J_search" lay-submit lay-filter="search" value="查询"/>    
              </div>                           
           </form>
            <fieldset class="layui-elem-field">
              <legend>节点列表</legend>
              <div class="layui-field-box">
                  <div id="node_content"></div>
              </div>
            </fieldset>
			<fieldset class="layui-elem-field">
				<legend>定时任务列表</legend>
				<div class="layui-field-box layui-form">
					<table class="layui-table admin-table">
						<thead>
							<tr>
								<th width="*">定时器名称</th>
					            <th width="180">执行时间cron</th>
					            <th width="30px">启用</th>
					            <th width="150px">当前节点</th>
					            <th width="140px">上次执行时间</th>
					            <th width="140px">下次执行时间</th>
					            <th width="100px">操作</th>
							</tr>
						</thead>
						<tbody id="content"></tbody>
					</table>
				</div>
			</fieldset>
		</div>
		<!--模板-->
		<script type="text/html" id="node_list_tpl">
           {{# layui.each(d.data.clusterNodes, function(index, item){ }}
           <button class="layui-btn layui-btn-primary">{{ item }}</button>
           {{# }); }}
        </script>
		<script type="text/html" id="task_list_tpl">
			{{# layui.each(d.data.jobs, function(index, item){ }}
			<tr>
				<td>{{ item.jobName }}</td>
				<td>
                  <input id="cron_{{index}}" lass="layui-input" type="text" value="{{ item.cronExpr }}" style="width:120px;">
                  <a href="javascript:;" class="layui-btn layui-btn-mini J_commond_btn" data-ref="#cron_{{index}}" data-id="{{ item.jobName }}" data-cmd="updatecron">更新</a>
                </td>
				<td>{{ item.active ? '是' : '否' }}</td>
                <td>{{ item.currentNodeId }}</td>
                <td>{{ item.lastFireTime }}</td>
                <td>{{ item.nextFireTime }}</td>
				<td>
                    <a href="javascript:;" class="layui-btn layui-btn-mini J_commond_btn" data-id="{{ item.jobName }}" data-cmd="switch" data="{{ item.active ? '0' : '1'}}">{{ item.active ? '停用' : '启用'}}</a>
                    <a href="javascript:;" data-id="{{ item.jobName }}" class="layui-btn layui-btn-mini J_commond_btn" data-cmd="exec">执行</a>
				</td>
			</tr>
			{{# }); }}
		</script>
		<script type="text/javascript" src="../webjars/plugins/layui/layui.js"></script>
        <script type="text/javascript" src="../webjars/js/common.js"></script>
        <script type="text/javascript" src="../webjars/js/moudule/schedule.js"></script>
	</body>

</html>